<template>
  <div>
    <h1>vue-xlsx-table</h1>
    <vue-xlsx-table @on-select-file="handleSelectedFile">上传xlsx文件转json</vue-xlsx-table>
    <download-excel
      class="export-excel-wrapper"
      :data="json_data"
      :fields="json_fields"
      name="学生信息模板.xlsx"
    >
      <el-button type="primary">学生信息模板</el-button>
    </download-excel>
  </div>
</template>

<script>
export default {
  data() {
    return {
      json_fields: {
        "姓名": "StuName",
        "学号": "StuId"
      },
      json_data: [],
      json_meta: [
        [
          {
            key: "charset",
            value: "utf-8"
          }
        ]
      ]
    };
  },
  created() {},
  mounted() {},
  methods: {
    handleSelectedFile(convertedData) {
      console.log(convertedData);
    }
  }
};
</script>

<style scoped >
</style>
